#ifndef PLAYER_H
#define PLAYER_H

#include <QString>
#include <QList>
#include "Game.h"
class Player
{
  public:
    Player(const QString &name);
    const QString& name() const;
    unsigned int games() const;
    unsigned int pointsScored() const;
    unsigned int wins() const;
    unsigned int losses() const;
    unsigned int escalations() const;
    unsigned int cancellations() const;
    unsigned int bagsMade() const;
    float ballShotPct() const;
    float bagShotPct() const;
    int rounds() const;
    float rating() const;
    void setGames(int games);
    void setPointsScored(int ps);
    void setWins(int wins);
    void setLosses(int losses);
    void setEscalations(int escallations);
    void setCancellations(int cancellations);
    void setBagsMade(int bagsmade);
    void setRating(float rating);
    void setRoundsPlayed(int rp);
    bool addGame(const Game& game);
    void adjustRating(const Player& op, bool didWin, int factor);
    QString toString() const;
    QString toFileString() const;
    void fromString(const QString& data);

    bool operator<(const Player& rhs) const;

  protected:
    QString mName;
    unsigned int mNumGames, mNumPointsScored, mWins,
                 mLosses, mEscalations, mBagsMade, mCancellations,
                 mRoundsPlayed, mOneAndOuts;
    float mRating;
};

#endif // PLAYER_H
